import java.util.Scanner;

public class Work5 {
    public static void main(String[] args) {
        //输出一个整数的每一位
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        while (num > 0) {
            System.out.println(num % 10);
            num /= 10;
        }
    }
}
